babl-cache: fix previous cache file persisting on Win32
authorEdward E <develinthedetail@gmail.com>
Fri, 7 Apr 2017 06:47:45 +0000 (01:47 -0500)
committerØyvind Kolås <pippin@gimp.org>
Fri, 7 Apr 2017 18:16:27 +0000 (20:16 +0200)
Cygwin's rename() won't overwrite an existing file, so remove() it first

babl/babl-cache.c

index f4981156153e2e1cfef4d52be5cd4d7c5ed11b84..abd6f0a8fa5797827d720996091a25b9cd8dc319 100644 (file)
@@ -188,6 +188,9 @@ void babl_store_db (void)
   }
   fclose (dbfile);
 
+#ifdef _WIN32
+  remove (fish_cache_path ());
+#endif
   rename (tmpp, fish_cache_path());
   free (tmpp);
 }